package com.wc.AlgoOJ_train.train1.c1.A101;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/12/26 3:42
 * 青年歌手大奖赛
 * http://43.138.190.70:8888/p/A101
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNextInt()) {
            int n = sc.nextInt();
            int max = -1;
            int min = 101;
            double sum = 0;
            for (int i = 0; i < n; i++) {
                int score = sc.nextInt();
                sum += score;
                max = Math.max(score, max);
                min = Math.min(score, min);
            }
            System.out.printf("%.2f\n",(sum - max - min) / (n - 2));
        }
    }
}
